<template>
    <div class="no-permission-container">
        <div class="no-permission-content">
            <div class="icon-wrapper">
                <el-icon :size="80" color="#409EFF">
                    <Lock />
                </el-icon>
            </div>
            <h2 class="title">暂无访问权限</h2>
            <p class="desc">您当前没有权限访问此页面，请联系管理员获取权限</p>
            <el-button type="primary" @click="goHome">返回首页</el-button>
        </div>
    </div>
</template>

<script setup lang="ts">
import { Lock } from '@element-plus/icons-vue'
import storage from '@/utils/storage';
import { useRouter } from 'vue-router';

storage.deleteKey("lastVisitedPath")
const router = useRouter()

const goHome = () => {
    router.push('/home')
}
</script>

<style scoped>
.no-permission-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f7fa;
}

.no-permission-content {
    text-align: center;
    padding: 40px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
}

.icon-wrapper {
    margin-bottom: 20px;
}

.title {
    font-size: 24px;
    color: #303133;
    margin-bottom: 16px;
}

.desc {
    font-size: 16px;
    color: #606266;
    margin-bottom: 24px;
    line-height: 1.5;
}
</style>